<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>会议列表管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
   <!-- <script src="../../../resources/static/js/common.js"></script>-->
    <script src="../../../resources/static/commomsjs/commons.js"></script>
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="../../../resources/static/manageWeb/css/font.css">
    <link rel="stylesheet" href="../../../resources/static/manageWeb/css/index.css">
    <script src="../../../resources/static/manageWeb/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="../../../resources/static/manageWeb/js/index.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.js"></script>
</head>
<body>
<div id="app">
<div class="x-nav">
          <span class="layui-breadcrumb">
            <a href="">首页</a>
            <a href="">演示</a>
            <a>
              <cite>导航元素</cite></a>
          </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                    <div class="layui-inline layui-show-xs-block" >
                        <select v-model="searchMeetTypeId" name="cateid" class="layui-select"> <!--v-model="searchMeetinfo.meetType.id"-->
                            <option value="0">全部分类</option>
                            <option v-for="meetType in meetTypes" :value="meetType.id" >{{meetType.typeName}}</option>
                        </select>
                    </div>
                    <div class="layui-inline layui-show-xs-block">
                        <input v-model="searchMeetTitle" type="text" placeholder="会议主题查询...." class="layui-input"><!--v-model.trim="searchMeetinfo.meetTitle">-->
                    </div>
                    <div class="layui-inline layui-show-xs-block">
                        <input class="layui-btn" name="sub" @click="initMeetinfos(1)" value="查询" type="button">
                    </div>
                <div class="layui-card-body ">
                </div>
                <!--<div class="layui-card-header">
                    <button id="batchDel" class="layui-btn layui-btn-danger" @click.prevent="batchDelete"><i class="layui-icon"></i>批量删除</button>
                </div>-->
                <div class="layui-card-body ">
                    <table class="layui-table layui-form">
                        <thead>
                        <tr>
                           <!-- <th>
                                <input  type="checkbox"  name=""   lay-skin="primary">全选
                            </th>-->
                            <th>ID</th>
                            <th>会议主题</th>
                           <!-- <th>会议图片</th>-->
                            <th>会议类型</th>
                            <th>会议地址</th>
                            <th>会议进程状态</th>
                            <th>会议创建时间</th>
                           <!-- <th>会议浏览量</th>-->
                            <th>是否轮播</th>
                            <th>审核状态</th>
                            <th>查看/操作</th>
                        </thead>
                        <tbody>
                        <tr v-for="meetinfo,index in meetinfos">
                           <!-- <td>
                                <input type="checkbox"  name=""  lay-skin="primary">
                            </td>-->
                            <td>{{meetinfo.id}}</td>
                            <td>{{meetinfo.meetTitle.substring(0,7)}}</td>
                           <!-- <td><img :src="`../../../resources/manageWeb/images/${meetinfo.meetPicture}`" style="max-width: 80px">
                                {{meetinfo.meetPicture}}</td>-->
                            <td>{{meetinfo.meetType.typeName}}</td>
                            <td>{{meetinfo.province.provinceName}}{{meetinfo.city.cityName}}{{meetinfo.reginon.reginonName}}{{meetinfo.detailsAddress}}</td>
                            <td>{{meetinfo.processState}}</td>
                            <td>{{meetinfo.createTime}}</td>
                            <td ><template v-if="meetinfo.shuffingEnable">
                                <img src="../../../resources/static/manageWeb/images/right.jpg" style="width: 25px;height: 25px" >
                            </template>
                                <template v-if="!meetinfo.shuffingEnable">
                                    <img src="../../../resources/static/manageWeb/images/error.jpg" style="width: 25px;height: 25px" >
                                </template>
                               </td>
                            <td>
                                <template v-if="meetinfo.aduditState" >
                                    <img src="../../../resources/static/manageWeb/images/right.jpg" style="width: 25px;height: 25px"  >
                                </template>
                                <template v-if="!meetinfo.aduditState">
                                    <img src="../../../resources/static/manageWeb/images/error.jpg" style="width: 25px;height: 25px" >
                                </template>
                                </td>
                            <td class="td-manage">
                                <a title="查看/编辑"  :href="`meetinfoLookManage.html?id=${meetinfo.id}`">
                                    <i class="layui-icon">&#xe642;</i>
                                </a>
                                <a title="删除"  @click="delMeetinfo(meetinfo.id,index)" href="#">
                                    <i class="layui-icon">&#xe640;</i>
                                </a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="layui-card-body ">
                    <div class="page">
                        <div>
                                <a v-for="i in page.navigatepageNums" href="#" @click="initMeetinfos(i)" >{{i}}</a><!--:class="{'current':page.pageNum==i}"-->
                                {{page.pageNum}}/{{page.pages}}页
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
</body>
<script>

    var app=new Vue({
        el:'#app',
        data:{
            meetTypes:[],
            path:"http://localhost:8080/",
            meetinfos:[],
            searchMeetTypeId:0,
            searchMeetTitle:'',
            page:null,
            searchMeetinfo:{meetType:{id:0},meetTitle:''}
            },
        created:function(){
        this.initMeetTypes();
       this.initMeetinfos(1);
        },
        methods:{

            changeSuffing:function(id){
                axios.get(this.path+"manage/changeSuffing?id="+id)
                .then(res=>{
                })

            },
            changeAdudit:function(id){
                axios.get(this.path+"manage/changeAudit?id="+id)
                    .then(res=>{
                    })
            },
            delMeetinfo:function(id,index){
               /* layer.confirm('确认要删除吗？',function() {*/
                if(!window.confirm("你确认要删除吗？")){
                    return;
                }
                    axios.get("http://localhost:8080/manage/delMeetinfo?id=" + id)
                        .then(res => {
                            console.log(index);
                            this.meetinfos.splice(index,1);
                            layer.msg('已删除!', {icon: 1, time: 1000});
                        });
              /*  })*/
            },
            initMeetTypes:function(){
            axios.get(this.path+"manage/selectTypeList")
                .then(res=>{
                    //console.log(res.data)
                    this.meetTypes=res.data.data;
                })
            },
            initMeetinfos:function(pageNum){
              /*var meetinfo=JSON.parse(JSON.stringify(this.searchMeetinfo))
                if(meetinfo.meetType.id==0){
                    meetinfo.meetType.id= null;
                }*/
              var data={
                  meetType:{id:null},
                    meetTitle:null

            };
              if(this.searchMeetTypeId!=0){
                data.meetType.id=this.searchMeetTypeId;
                }
              if(this.searchMeetTitle!=""){
                  data.meetTitle=this.searchMeetTitle;
              }
                axios.post(this.path+"manage/selectList?pageNum="+pageNum,data)
                    .then(res=>{
                   this.meetinfos=res.data.data;
                   this.meetinfos=res.data.data.list;
                   this.page=res.data.data;
                });
            }

        }
    })
   /* layui.use(['laydate','form'], function(){
        var laydate = layui.laydate;
        var form = layui.form;

        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#end' //指定元素
        });
    });*/
/*    /!*用户-停用*!/
    function member_stop(obj,id){
        layer.confirm('确认要停用吗？',function(index){

            if($(obj).attr('title')=='启用'){

                //发异步把用户状态进行更改
                $(obj).attr('title','停用')
                $(obj).find('i').html('&#xe62f;');

                $(obj).parents("tr").find(".td-status").find('span').addClass('layui-btn-disabled').html('已停用');
                layer.msg('已停用!',{icon: 5,time:1000});

            }else{
                $(obj).attr('title','启用')
                $(obj).find('i').html('&#xe601;');

                $(obj).parents("tr").find(".td-status").find('span').removeClass('layui-btn-disabled').html('已启用');
                layer.msg('已启用!',{icon: 5,time:1000});
            }

        });
    }

    /!*用户-删除*!/
    function member_del(obj,id){
        layer.confirm('确认要删除吗？',function(index){
            //发异步删除数据
            $(obj).parents("tr").remove();
            layer.msg('已删除!',{icon:1,time:1000});
        });
    }



    function delAll (argument) {

        var data = tableCheck.getData();

        layer.confirm('确认要删除吗？'+data,function(index){
            //捉到所有被选中的，发异步进行删除
            layer.msg('删除成功', {icon: 1});
            $(".layui-form-checked").not('.header').parents('tr').remove();
        });
    }*/
   /* function member_del(obj,id){
        alert(id);
        layer.confirm('确认要删除吗？',function(index){
            //发异步删除数据
            $(obj).parents("tr").remove();
            axios.get("http://localhost:8080/manage/delMeetinfo?id"+id)
                .then(res=>{
                    layer.msg('已删除!',{icon:1,time:1000});
                });

        });
    }*/
</script>
<!--<script>var _hmt = _hmt || []; (function() {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();</script>-->
</html>